package co.yixiang.mall.common.hystrix;


import co.yixiang.common.core.api.ApiResult;
import co.yixiang.mall.common.feign.RemoteOrderService;
import co.yixiang.mall.common.mall.domain.YxUserRecharge;
import co.yixiang.mall.common.order.domain.YxStoreOrder;
import co.yixiang.mall.common.order.vo.YxStoreOrderQueryVo;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 用户服务降级处理
 * @author yshop
 */
@Component
public class RemoteOrderFallbackFactory implements FallbackFactory<RemoteOrderService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteOrderFallbackFactory.class);

    @Override
    public RemoteOrderService create(Throwable throwable)
    {
        log.error("用户服务调用失败:{}", throwable.getMessage());

        return new RemoteOrderService()
        {
            @Override
            public ApiResult<YxStoreOrderQueryVo> orderDetail(String key) {
                return null;
            }

            @Override
            public void yuePay(String orderId, Long uid) {

            }

            @Override
            public YxUserRecharge getOneByOrderId(String orderId) {
                return null;
            }

            @Override
            public void paySuccess(String orderId, String payType) {

            }

            @Override
            public void updateRecharge(YxUserRecharge userRecharge) {

            }

            @Override
            public String getData(String name) {
                return null;
            }

            @Override
            public void updateById(YxStoreOrder storeOrder) {

            }

            @Override
            public void retrunStock(String orderId) {

            }

            @Override
            public void integralPay(String orderId, Long uid) {

            }
        };
    }
}
